angular.module('myApp')
  .controller('LinkCtrl', ['$scope', 'CryptoService', function ($scope, CryptoService) {
    // 确保密钥长度严格为32字节
    const secretKey = 'your-32bytes-secret-key-1234567890ab'; // 示例有效密钥
    const originalData = '1'
    // console.log(atob(btoa(originalData)));
    // 加密
    $scope.encrypted = CryptoService.encrypt(originalData, secretKey);
    console.log('加密结果:', $scope.encrypted); // 输出类似 U2FsdGVkX1+3qJ4Z6T2W4A==

    // 解密
    $scope.decrypted = CryptoService.decrypt($scope.encrypted, secretKey);
    console.log('解密结果:', $scope.decrypted); // 应输出 SensitiveData123
  }])
  .directive('elLink', elLink);